<?php

if (!defined('EBY_IN')){
	exit('HACKING NO INFO');
}
class mold extends base {
	public $val;
	public $strSQL;
	public function __construct(){
		parent::__construct();
		$this->loadlib('fso');
	}
	
	public Function addmoldpro($var,$t='admin',$userid=0){
		$this->val = $var;
		if ($t=='admin'){
			$this->strSQL="INSERT INTO ".DB_PREFIX."mold (eby_moldname,eby_molddir,eby_moldon)VALUES('".$this->val[0]."','".$this->val[1]."',1)";
			L('fso')->createdir(EBY_ROOT.'view/sking/'.$this->val[1]);
			L('fso')->createdir(EBY_ROOT.'view/sking/'.$this->val[1].'/mytag');
			L('fso')->createdir(EBY_ROOT.'view/sking/'.$this->val[1].'/mypage');
			L('fso')->createfile(EBY_ROOT.'view/sking/'.$this->val[1].'/mytag/my_issystmechkfile.dwt');
		} elseif ($t=='user'){
		}
		$this->db->getSqlstr($this->strSQL);
		unset($this->val,$t);
		return $this->db->insertSql();
	}

	public function getmoldprolist(){
		return $this->db->get_all("SELECT * FROM ".DB_PREFIX."mold");
	}
	public function get_system_templatefile(){
		
	}
	public function get_user_templatefile(){
		
	}
	public function save_template_content($name='',$path=''){
		
	}
	public function get_proinfo($id=null,$fd='*'){
		return $this->db->get_one("SELECT ".$fd." FROM ".DB_PREFIX."mold WHERE eby_moldid=$id");
	}
	public function del_pro($id){
		return $this->db->exect("DELETE FROM ".DB_PREFIX."mold WHERE eby_moldid=$id");
	}
}


?>